﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyServer.Common
{
    /// <summary>
    /// 用来存储数据操作器操作数据的事件数据绑定
    /// </summary>
    public class DataBeforeOperateEventArgs : EventArgs
    {   

        #region==========属性=========
        /// <summary>
        /// 表示与事件绑定的数据
        /// </summary>
        public DataPackageCollection OperateData { get; private set; }

        /// <summary>
        /// 表示该事件是否需要取消或是取消状态
        /// </summary>
        public bool Canceled { get; set; }

        #endregion

        /// <summary>
        /// 构造事件绑定数据的新实例
        /// </summary>
        /// <param name="col"></param>
        public DataBeforeOperateEventArgs(DataPackageCollection col)
        {
            this.OperateData = col;
        }

    }

    /// <summary>
    /// 用来存储数据发送器发送数据的事件数据绑定
    /// </summary>
    public class DataAfterOperateEventArgs : EventArgs
    {

        /// <summary>
        /// 表示与事件绑定的数据
        /// </summary>
        public DataPackageCollection OperateData { get; private set; }

        /// <summary>
        /// 表示操作完成后需要返回的数据
        /// </summary>
        public DataPackageCollection ResultData { get;internal set; }

        /// <summary>
        /// 表示该操作是否需要取消或是取消状态
        /// </summary>
        public bool Canceled { get; set; }

        /// <summary>
        /// 表示操作结果
        /// </summary>
        public OperateResult Result { get; set; }

        /// <summary>
        /// 构造事件绑定数据的新实例
        /// </summary>
        /// <param name="col"></param>
        public DataAfterOperateEventArgs(DataPackageCollection col, DataPackageCollection result)
        {
            this.OperateData = col;
            this.ResultData = result;
        }

    }
}
